package com.topscomm.mis.cbb.pm.base.job;

import com.topscomm.mis.cbb.pm.base.service.ICbbPmNoticeRecordService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author wangjielei
 * @Description 运行数据采集周期任务执行
 * @Date 2023/2/13 16:13
 * @Param
 * @return
 **/
@Component
@JobHandler(value = "CbbSendNoticeJob")
@Slf4j
public class CbbSendNoticeJob extends IJobHandler {

    @Autowired
    private ICbbPmNoticeRecordService cbbPmNoticeRecordService;

   /**
    * @return com.xxl.job.core.biz.model.ReturnT<java.lang.String>
    * @Author wangjielei
    * @Description 消息提醒
    * @Date 2023/6/25 11:30
    * @Param [param]
   **/
    @Override
    public ReturnT<String> execute(String param) throws Exception {
        try {
            cbbPmNoticeRecordService.sendNotice();
            return SUCCESS;
        }catch (Exception e ){
            e.printStackTrace();
            log.error("消息提醒任务执行CbbSendMessageJob执行失败！");
            return ReturnT.FAIL;
        }
    }
}
